//
//  ButtomLogoView.m
//  Unity-iPhone
//
//  Created by Karl on 2017/3/28.
//
//

#import "ButtomLogoView.h"

@implementation ButtomLogoView{
    UIImageView *_bg;
    UIImageView *_medialink;
    UIImageView *_oxfam;
    UIImageView *_left;
    UIImageView *_right;
}

- (instancetype)init{
    self = [super init];
    if (self) {
        
        self.backgroundColor = [UIColor lightGrayColor];
        
        _bg = [[UIImageView alloc] init];
        [_bg setImage:kImgFromFile(@"bottom_bg", @"png")];
        [self addSubview:_bg];
        
//        _medialink = [[UIImageView alloc] init];
//        [_medialink setImage:kImgFromFile(Babel(@"bottom_medialink"), @"png")];
//        [self addSubview:_medialink];
//
//        _oxfam = [[UIImageView alloc] init];
//        [_oxfam setImage:kImgFromFile(@"bottom_oxfam_tlp", @"png")];
//        [self addSubview:_oxfam];

        _left = [UIImageView new];
        [_left setImage:kImgFromFile(@"bottom_left", @"png")];
        [self addSubview:_left];
        
        _right = [UIImageView new];
        [_right setImage:kImgFromFile(Babel(@"bottom_right"), @"png")];
        [self addSubview:_right];
        
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    
    CGFloat scale = 1.0;
    if (isPad) {
        scale = SizeScaleX;
    }else{
        scale = SizeScaleY;
    }
    
    _bg.left = 0;
    _bg.top = 0;
    _bg.width = self.width;
    _bg.height = self.height;
    
//    _medialink.width = 284.6  * scale;
//    _medialink.height = 31.7  * scale;
//    _medialink.left = 23.3  * scale;
//    _medialink.centerY = self.height/2;
//
//    _oxfam.width = 306  * scale;
//    _oxfam.height = 40.3  * scale;
//    _oxfam.right = self.right - 23.3  * scale;
//    _oxfam.centerY = self.height/2;

    _left.width = 150  * scale;
    _left.height = 56  * scale;
    _left.left = 23.3  * scale;
    _left.centerY = self.height/2;
    
    _right.width = 359  * scale;
    _right.height = 56  * scale;
    _right.right = self.right - 23.3  * scale;
    _right.centerY = self.height/2;

}
@end
